<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--
  Created by IntelliJ IDEA.
  User: 凡人
  Date: 2021/11/22
  Time: 9:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <!--视口 自适应-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>title</title>
    <link href="${pageContext.request.contextPath}/static/css/bootstrap.css" rel="stylesheet">
    <script src="${pageContext.request.contextPath}/static/js/jquery-3.2.1.js" rel="script"></script>
    <script src="${pageContext.request.contextPath}/static/js/bootstrap.js" rel="script"></script>
    <script src="${pageContext.request.contextPath}/static/My97DatePicker/WdatePicker.js" rel="script"></script>

</head>
<body>
<c:if test="${user!=null}">
    <h3>
        欢迎<font style="color: red;font-size: 40px;">${user.user}</font>登陆
    </h3>
</c:if>
<form action="./list" method="post">
    订单编号:<input type="text" name="orderid" value="${d.orderid}">
    <select name="field1">
        <option value="">-- 请选择--</option>
        <option value="odate" ${d.field1=="odate"?"selected":''}>下单时间</option>
    </select>
    <input type="text" name="startDate" readonly="readonly" onclick="WdatePicker()" value="<fmt:formatDate value="${d.startDate}" pattern="yyyy-MM-dd"></fmt:formatDate> ">
    <input type="text" name="endDate" readonly="readonly" onclick="WdatePicker()" value="<fmt:formatDate value="${d.endDate}" pattern="yyyy-MM-dd"></fmt:formatDate>">
    备注:<input type="text" name="content" value="${d.content}"><br>

    <select name="field2">
        <option value="">-- 请选择--</option>
        <option value="user" ${d.field2=="user"?"selected":''}>制单人</option>
        <option value="depot" ${d.field2=="depot"?"selected":''}>仓库</option>
        <option value="place" ${d.field2=="place"?"selected":''}>库位</option>
        <option value="orderer" ${d.field2=="orderer"?"selected":''}>订货人</option>
        <option value="number" ${d.field2=="number"?"selected":''}>物流单号</option>
        <option value="site" ${d.field2=="site"?"selected":''}>交货地点</option>
    </select>
    <input type="text" name="val"  value="${d.val}">

    <select name="field3">
        <option value="">-- 请选择--</option>
        <option value="oprice" ${d.field3=="oprice"?"selected":''}>总金额</option>
        <option value="discount" ${d.field3=="discount"?"selected":''}>折让成本</option>
        <option value="cost"  ${d.field3=="cost"?"selected":''}>附件成本</option>
    </select>
    <input type="text" name="startPrice"  value="${d.startPrice}">
    <input type="text" name="endPrice"  value="${d.endPrice}">
    <a href=""></a>
    <a href=""></a>
    <input type="button" onclick="tj(1)" value="搜索">
</form>
<table class="table">
    <thead>
    <tr>
        <th scope="col">下单时间</th>
        <th scope="col">订单编号</th>
        <th scope="col">制单人</th>
        <th scope="col">仓库</th>
        <th scope="col">库位</th>
        <th scope="col">订货人</th>
        <th scope="col">总金额</th>
        <th scope="col">折让金额</th>
        <th scope="col">交货方式</th>
        <th scope="col">物流单号</th>
        <th scope="col">附件成本</th>
        <th scope="col">交货地点</th>
        <th scope="col">操作</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach var="i" items="${list.list}">
        <tr>
            <td>
                <fmt:formatDate value="${i.odate}" pattern="yyyy-MM-dd"></fmt:formatDate>
            </td>
            <td>${i.orderid}</td>
            <td>${i.user.user}</td>
            <td>${i.depot}</td>
            <td>${i.place}</td>
            <td>${i.orderer}</td>
            <td>${i.oprice}</td>
            <td>${i.discount}</td>
            <td>${i.way}</td>
            <td>${i.number}</td>
            <td>${i.cost}</td>
            <td>${i.site}</td>
        </tr>
    </c:forEach>
    <tr>
        <td colspan="100">
            <jsp:include page="/static/common/pages.jsp"></jsp:include>
        </td>
    </tr>
    </tbody>
</table>
</body>
<script>
    function tj(cur){
        $("#nav-tabContent").load("./list?cur="+cur+"&"+$("form").serialize());
    }
</script>
</html>
